package nojava;

import java.lang.reflect.Method;

public class MainMain {
    public static void main(String[] args) throws Exception {
        Class clazz = Class.forName("nojava.Student");
        Object instance = clazz.getConstructor().newInstance();

      /*  Method say = clazz.getMethod("say");
        say.invoke(instance);*/

        Class superclass = clazz.getSuperclass();//Class.forName("nojava.Person");

        System.out.println(superclass.getName() );
        Method declaredMethod = superclass.getDeclaredMethod("say");
        declaredMethod.setAccessible(true);
        declaredMethod.invoke(instance);

    }
}
